package realtityTest;

import java.util.Scanner;

public class 裁剪网格线 {
	 public static void main(String[] args) {
	        Scanner scanner = new Scanner(System.in);
	        while(scanner.hasNext()){
	            int n = scanner.nextInt();
	            int maxX = 0;
	            int maxY = 0;
	            while(n-->0){
	                int x = scanner.nextInt();
	                int y = scanner.nextInt();
	                maxX = maxX< x ?x:maxX;
	                maxY = maxY< y ?y:maxY;
	            }
	            int max = maxX>maxY?maxX:maxY;
	            System.out.println(max*max);
	        }
	    }
}
